public static int ifIt(int x) {
int retval;
if (x > 10)
retval = x + 5;
else
retval = x;
return retval;
}
Function Call | Return Value | |||
---|---|---|---|---|
ifIt(5) | → | |||
ifIt(15) | → | |||
ifIt(0) | → | |||
ifIt(10) | → | |||
ifIt(13) | → | |||
ifIt(20) | → | |||
ifIt(3) | → |
Experiment with this code on Gitpod.io